# Maintainer: Anatol Pomozov

pkgname=aws-c-http
pkgver=0.7.7
pkgrel=1
pkgdesc='C99 implementation of the HTTP/1.1 and HTTP/2 specifications'
arch=(loong64 x86_64)
url='https://github.com/awslabs/aws-c-http'
license=(Apache)
depends=(aws-c-common aws-c-compression aws-c-io)
makedepends=(cmake)
source=(aws-c-http-$pkgver.zip::https://github.com/awslabs/aws-c-http/archive/v$pkgver.zip)
sha256sums=('c8e83504509d7db0e11c46966087399db7a88fb7f2a81e94cbc6bded864af6a8')

build() {
  cd aws-c-http-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -S . -B build
  cmake --build build
}

check() {
  cd aws-c-http-$pkgver
  cmake --build build --target test
}

package() {
  cd aws-c-http-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
